- /* sloshftr.cpp by K.Tsuru */
- // function ID = 243 DRADIX
- /***********************
- SLong class
- bit shift operator m>>n
- It devides by 2^n.
- ***********************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- SLong operator>>(const SLong& m, ulong n)
- {
- if(!n || (m.Sign(243) == 0)) return m;
-
- double x = (n < 100L) ? pow(2.0, (int)n) : DBL_MAX; // ver.2.17
- if(x < (double)m.SlOpMaxValue()){
- ulong d = 1L << (int)n;
- return LsDiv(m, d);
- }
- SLong two(m.Type(), m.MinSize(), 2L); // two = 2;
- SLong den = Lpow(two, n);
- return m/den;
- }
sloshftr.cpp : last modifiled at 2015/11/27 14:26:46(562 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).